package com.acme.bankapp.domain.bank;

public class SavingAccount implements Account {
	private double balance;

	public SavingAccount(double balance) {
		super();
		this.balance = balance;
	}

	/* (non-Javadoc)
	 * @see com.acme.bankapp.domain.bank.AccountIface#getBalance()
	 */
	@Override
	public double getBalance() {
		return balance;
	}

	/* (non-Javadoc)
	 * @see com.acme.bankapp.domain.bank.AccountIface#deposite(double)
	 */
	@Override
	public void deposite(double amount) {
		this.balance += amount;
	}
	
	/* (non-Javadoc)
	 * @see com.acme.bankapp.domain.bank.AccountIface#withdraw(double)
	 */
	@Override
	public void withdraw(double amount) {
		if (this.balance >= amount)
			this.balance -= amount;
	}
}
